<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>

    <title>我的配送</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>

</head>
<body>
<!-- 导航条-->
<div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow">
    <h5 class="my-0 mr-md-auto font-weight-normal">快马跑腿</h5>
    <nav class="my-2 my-md-0 mr-md-3">
        <a class="p-2 text-dark" th:href="@{/order/index}" >首页</a>
        <a class="p-2 text-dark" th:href="@{/order/addForSell}">帮我买</a>
        <a class="p-2 text-dark" th:href="@{/order/addForDeliver}">帮我送</a>
        <a class="p-2 text-dark" th:href="@{/order/addForTake}">帮我取</a>
        <td>
            <a class="p-2 text-dark"  th:if="${session.customer.type ==1}" th:href="@{/client/aboutUs}">关于我们</a>
            <a class="p-2 text-dark"  th:if="${session.customer.type ==2}" th:href="@{/order/list}">我的配送</a>

        </td>

    </nav>
    <nav id="navbar-example2" class="navbar navbar-light bg-light">
        <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" th:text="${customer.nickname}">Dropdown</a>
        <div class="dropdown-menu">
            <a class="dropdown-item" th:href="@{/client/info}">个人信息</a>
            <a class="dropdown-item" th:href="@{/order/myOrder}">我的订单</a>
            <div role="separator" class="dropdown-divider"></div>
            <a class="dropdown-item" th:href="@{/publiz/index}">注销</a>
        </div>
    </nav>
</div>
<div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
    <h1 class="display-4">快马跑腿</h1>
    <p class="lead">1 to 1 professional service, send faster, do more</p>
</div>
<div class="container-fluid">
    <div class="row">
        <table class="table">
            <thead>
            <tr>
                <th>#</th>
                <th>订单类型</th>
                <th>收货人姓名</th>
                <th>收货人电话</th>
                <th>送货人姓名</th>
                <th>送货人电话</th>
                <th>帮送/买/取物品</th>
                <th>取货地址</th>
                <th>买货商店</th>
                <th>订单状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="item : ${page.content}">
                <td>#</td>
                <td>
                    <span th:if="${item.type == 1}">帮买</span>
                    <span th:if="${item.type == 2}">帮送</span>
                    <span th:if="${item.type == 3}">帮取</span>
                </td>
                <td th:text="${item.consignee}">#</td>
                <td th:text="${item.consigneeMobile}">#</td>
                <td th:text="${item.consigner}">#</td>
                <td th:text="${item.consigneeMobile}">#</td>
                <td th:text="${item.goods}">#</td>
                <td th:text="${item.pickupAddress}">#</td>
                <td th:text="${item.store}">#</td>
                <td>
                    <span th:if="${item.status == 1}">下单成功</span>
                    <span th:if="${item.status == 2}">已指派</span>
                    <span th:if="${item.status == 3}">配送中</span>
                    <span th:if="${item.status == 4}">已送达</span>
                    <span th:if="${item.status == 5}">已收货</span>
                    <span th:if="${item.status == 6}">已评价</span>
                </td>
                <td>
                    <a th:if="${item.status == 2}" th:href="@{/order/receipt(id=${item.id})}">领取订单</a>
                    <a th:if="${item.status == 3}" th:href="@{/order/sendTo(id=${item.id})}">确认送达</a>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="11">
                    <a th:href="@{/order/list(start=0)}">[首页]</a>&nbsp;&nbsp;
                    <a th:if="${not page.isFirst()}" th:href="@{/order/list(start=${page.number-1})}">[上页]</a>&nbsp;&nbsp;
                    <a th:if="${not page.isLast()}" th:href="@{/order/list(start=${page.number+1})}">[下页]</a>&nbsp;&nbsp;
                    <a th:href="@{/order/list(start=${page.totalPages-1})}">[末页]</a>
                </td>
            </tr>
            </tfoot>
        </table>
    </div>

</div>
<hr/>


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
</body>
</html>
